/*-
 * $Id: ConsoleUi.java 4 2010-11-04 07:39:56Z andrewbass $
 */

package com.google.code.getwrong;

import static java.text.MessageFormat.format;

import java.io.PrintStream;

/**
 * @author Andrew ``Bass'' Shcheglov (andrewbass@gmail.com)
 * @author $Author: andrewbass $
 * @version $Revision: 4 $, $Date:: 2010-11-04 07:39:56 +0000 #$
 */
final class ConsoleUi implements Ui {
	private final PrintStream out;

	/**
	 * @param out
	 */
	ConsoleUi(final PrintStream out) {
		this.out = out;
	}

	/**
	 * @see Ui#init()
	 */
	@Override
	public void init() {
		// empty
	}

	/**
	 * @see Ui#usage()
	 */
	@Override
	public void usage() {
		ConsoleUi.this.println("Usage: {0} [FILE...]", Main.class.getName());
	}

	/**
	 * @see Ui#println(String)
	 */
	@Override
	public void println(final String message) {
		ConsoleUi.this.out.println(message);
	}

	/**
	 * @see Ui#println(String, Object[])
	 */
	@Override
	public void println(final String pattern, final Object ... arguments) {
		ConsoleUi.this.println(format(pattern, arguments));
	}

	/**
	 * @see Ui#setProgressValue(long)
	 */
	@Override
	public long setProgressValue(final long n) {
		return n;
	}

	/**
	 * @see Ui#setProgressMaximum(long)
	 */
	@Override
	public void setProgressMaximum(final long n) {
		// empty
	}

	/**
	 * @see Ui#enableExit()
	 */
	@Override
	public void enableExit() {
		// empty
	}
}
